package com.hexinfo.dmpro.dev.data.transfer.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@AllArgsConstructor
public enum DevDataTransferImportTaskStatusEnum {

    build("构建中", "build"),

    running("执行中", "running"),

    suspend("暂停", "suspend"),

    finish("完成", "finish"),

    fail("构建失败", "fail"),

    abolish("中止", "abolish");

    @Getter
    private final String name;

    @Getter
    private final String value;

    public static List<String> getValues() {
        return Arrays.stream(DevDataTransferImportTaskStatusEnum.values()).map(DevDataTransferImportTaskStatusEnum::getValue).collect(Collectors.toList());
    }

    public static DevDataTransferImportTaskStatusEnum getByValue(String value) {
        return DevDataTransferImportTaskStatusEnum.valueOf(value);
    }
}
